<?php
$sql_where      = " from tblnewsletter_email ";
if(!empty($search))
{
    $sql_where .= " where cEmail like '$search%' ";
}
$sql_select     = "select count(iId) as count ".$sql_where;
$result         = $dbsql->query_fetch($sql_select);
$count_all      = $result['count'];

list($limit_st,$limit_le)	=Slit_Page($count_all);

$sql_select     = "select * ".$sql_where." order by iId desc limit $limit_st,$limit_le";
$rs             = $dbsql->query($sql_select);
$emails      = $dbsql->fetch_rows_array($rs);

?>